//package com.security;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.security.SecurityProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.annotation.Order;
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//
//@Configuration
////@Order(SecurityProperties.DEFAULT_FILTER_ORDER)
////@EnableWebSecurity
//public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
//
////    @Autowired
////    private BCryptPasswordEncoder passwordEncoder;
//
//    @Override
//    protected void configure(HttpSecurity http) throws Exception {
//        //super.configure(http);
//        http.authorizeRequests()
//                .antMatchers("/", "/home","/find/*").permitAll()// 这三个目录不做安全控制
//                .anyRequest().authenticated()
//                .and()
//                .formLogin().permitAll(); // 登录不需要安全控制
//    }
//
//    @Override
//    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//        super.configure(auth);
////        auth.inMemoryAuthentication()
////                .withUser("user").password(passwordEncoder.encode("123")).roles("USER")
////                .and()
////                .withUser("admin").password(passwordEncoder.encode("admin")).roles("USER", "ADMIN");
//    }
//
////    / spring security 必须有一个passwordEncoder
////    @Bean
////    public BCryptPasswordEncoder passwordEncoder() {
////        return new BCryptPasswordEncoder();
////    }/
//
//}
